<!DOCTYPE HTML>
<html>
<head>
  {include file="common/head" /}
  <style>
    .header {color: #fff; font-size: 32px; text-indent: 30px;}
  </style>
</head>
<body>
  <input type="hidden" id="TenantId" name="TenantId" value="" />
  <div class="header" style="background-image: none">香港美妆 - 进销存系统</div>
  <div class="loginWraper">
    <div class="loginBox">
      <form id="form-admin-login" class="form form-horizontal" action="{url:Admin/login}" method="post">
        <div class="row clearfix">
          <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
          <div class="form-controls col-xs-7">
            <input id="admin_name" name="admin_name" type="text" placeholder="用户名" class="input-text size-L">
          </div>
        </div>
        <div class="row clearfix">
          <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
          <div class="form-controls col-xs-7">
            <input id="password" name="password" type="password" placeholder="密码" class="input-text size-L">
          </div>
        </div>
        <div class="row clearfix">
          <div class="form-controls col-xs-7 col-xs-offset-3">
            <input id="captcha" name="captcha" class="input-text size-L" type="text" placeholder="验证码2位" onblur="if(this.value==''){this.value='验证码:'}" onclick="if(this.value=='验证码:'){this.value='';}" value="" style="width:150px;">
            <img src="{:captcha_src()}" onclick="refreshVerify()" id="verify_img" width="66"/><br>
            <a id="kanbuq" href="javascript:;" onclick="refreshVerify()">看不清，换一张</a>
          </div>

        </div>
        <div class="row clearfix">
          <div class="form-controls col-xs-7 col-xs-offset-3">
            <label for="online">
              <input type="checkbox" name="online" id="online" value="">
          使我保持登录状态
            </label>
          </div>
        </div>
        <div class="row clearfix">
          <div class="form-controls col-xs-8 col-xs-offset-3">
            <input name="" type="submit" class="btn btn-success radius size-L" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
            <input name="" type="reset" class="btn btn-default radius size-L" value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;">
          </div>
        </div>
      </form>
    </div>
  </div>
  <div class="footer">Copyright 香港美妆</div>

  <script type="text/javascript" src="__ROOT__/lib/jquery/1.9.1/jquery.min.js"></script>
  <script type="text/javascript" src="__ROOT__/static/h-ui/js/H-ui.min.js"></script>
  <script type="text/javascript" src="__ROOT__/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
  <script type="text/javascript" src="__ROOT__/lib/jquery.validation/1.14.0/validate-methods.js"></script>
  <script type="text/javascript" src="__ROOT__/lib/jquery.validation/1.14.0/messages_zh.js"></script>
  <script type="text/javascript">
    $(function(){
      /* 表单验证，提交 */
      $("#form-admin-login").validate({
        rules: {
          admin_name: {
            required:true,
          },
          password: {
            required:true,
            rangelength: [1, 16]
          },
          captcha: {
            required:true,
          }
        },
        messages: {
          admin_name: {
            required: "账户不能为空"
          },
          password: {
            required: "密码不能为空",
            rangelength: "密码长度6到16个字符"
          },
          captcha: {
            required: "验证码不能为空"
          },
        },
        onkeyup: false,
        focusCleanup: false,
        submitHandler: function(form) {
          //在这里执行表单提交
          form.submit();
          console.log(form)
        }
      });
    });
    function refreshVerify() {
      var ts = Date.parse(new Date())/1000;
      var img = document.getElementById('verify_img');
      img.src = "/captcha?id="+ts;
    }
  </script>
</body>
</html>
